home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / ldapjdk.jar / netscape / ldap / ber / stream / BERBoolean.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-04-13  |  1007 b   |  48 lines

  1. package netscape.ldap.ber.stream;
  2.  
  3. import java.io.IOException;
  4. import java.io.InputStream;
  5. import java.io.OutputStream;
  6.  
  7. public class BERBoolean extends BERElement {
  8.    private boolean m_value = true;
  9.  
  10.    public BERBoolean(boolean var1) {
  11.       this.m_value = var1;
  12.    }
  13.  
  14.    public BERBoolean(InputStream var1, int[] var2) throws IOException {
  15.       int var3 = var1.read();
  16.       int var10002 = var2[0]++;
  17.       var3 = var1.read();
  18.       var10002 = var2[0]++;
  19.       if (var3 > 0) {
  20.          this.m_value = true;
  21.       } else {
  22.          this.m_value = false;
  23.       }
  24.    }
  25.  
  26.    public void write(OutputStream var1) throws IOException {
  27.       var1.write(1);
  28.       var1.write(1);
  29.       if (this.m_value) {
  30.          var1.write(255);
  31.       } else {
  32.          var1.write(0);
  33.       }
  34.    }
  35.  
  36.    public boolean getValue() {
  37.       return this.m_value;
  38.    }
  39.  
  40.    public int getType() {
  41.       return 1;
  42.    }
  43.  
  44.    public String toString() {
  45.       return "Boolean {" + this.m_value + "}";
  46.    }
  47. }
  48.